#创建
# 列表存储单一维度的数据
list_name = ["刘备","关羽","张飞"]
list_age = [28,27,26]
list_sex = ["男","男","男"]
# 字典存储多个维度的数据
dict_lb = {"name":"刘备","age":28,"sex":"男"}
dict_gy = {"name":"关羽","age":27,"sex":"男"}
dict_zf = {"name":"张飞","age":26,"sex":"男"}

#列表删除
list02 = [10,20,30,40]
del list02[1] #元素向前移动（优先）
list02.remove(30) #从头开始遍历，找到后进行删除

# 字典联系1
dict_xg = {"address":"香港","new_add":7,"current":171,"sum":11531,"cure":11155,"over":205}
dict_yn = {"address":"云南","new_add":2,"current":68,"sum":301,"cure":231,"over":2}
dict_gd = {"address":"广东","new_add":1,"current":40,"sum":2290,"cure":2242,"over":8}

if "香港" == dict_xg.get("address"):
    print(dict_xg.get("current"))

if "云南" == dict_yn.get("address"):
    print(dict_yn.get("new_add"))
    print(dict_yn.get("current"))

for k,v in dict_xg.items():
    print(k)

for k,v in dict_yn.items():
    print(v)

for k,v in dict_gd.items():
    print(k)
    print(v)

dict_result = {}
for number in range(10):
    dict_result[number] = number**2
print(dict_result)

dict_result1 = {number:number**2 for number in range(10)}
print(dict_result1)

list_name = ["张无忌","赵敏","周芷若"]
list_home = [101,102,103]
dict_re = {}
for i in range(3):
    dict_re[list_name[i]] = list_home[i]
print(dict_re)

dict_re1 = {list_name[i]:list_home[i] for i in range(3)}
print(dict_re1)

dict_person = {
    "经理": {"曹操","刘备","孙权"},
    "技术": {"曹操","刘备","张飞","关羽"}
}

print(dict_person["经理"] & dict_person["技术"])
print(dict_person["经理"] - dict_person["技术"])
print(dict_person["技术"] - dict_person["经理"])
print(dict_person["技术"] ^ dict_person["经理"])
print(len(dict_person["技术"] | dict_person["经理"]))





